package pack0622;

import java.util.Scanner;

public class DemoH {
    public static void main(String[] args){
        Scanner chars=new Scanner(System.in);
        System.out.println("请输入字符：");
        String character=chars.nextLine();
        int x=character.length();
        int a1=0;
        int a2=0;
        int a3=0;
        int a4=0;
        for (int i=0;i<character.length();i++){
            int y=character.charAt(i);
            if (y>=65&&y<=90){
                a1++;
            }
            else if (y>=97&&y<=122){
                a2++;
            }
            else if (y==32){
                a3++;
            }
            else a4++;
        }
        System.out.println("大写字母个数为："+a1);
        System.out.println("小写字母个数为："+a2);
        System.out.println("空格个数为："+a3);
        System.out.println("其他字符个数为："+a4);
    }
}
